# Contributor: Michael M <mic@hael.xyz>
# Maintainer: Michael M <mic@hael.xyz>
pkgname=zycore-dev
pkgver=1.4.1
pkgrel=0
pkgdesc="Independent types for Zyantific projects (development files)"
url="https://github.com/zyantific/zycore-c"
arch="x86 x86_64 aarch64 armhf armv7 ppc64le riscv64"
license="MIT"
makedepends="cmake samurai"
source="$pkgname-$pkgver.tar.gz::https://github.com/zyantific/zycore-c/archive/v$pkgver/zycore-c-$pkgver.tar.gz"
builddir="$srcdir/zycore-c-$pkgver"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		local crossopts="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=ON \
		-DCMAKE_BUILD_TYPE=None \
		$crossopts
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
8cfb1b5dc49ae1d3216398b125125ced52603c6ae7772d08ff5f8c7be0ab7d7aa257f70678f7afa7805b7937520808fa5968ae98bfe7604e46c56e79460c0b5e  zycore-dev-1.4.1.tar.gz
"
